package com.example.a313ldy.yuejian_17.Activity;

import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.ImageButton;
import android.widget.ImageView;
import android.widget.TextView;

import com.example.a313ldy.yuejian_17.R;
import com.squareup.picasso.Picasso;

/**
 * Created by LDY on 2017/10/24.
 */

public class Contest_detail extends AppCompatActivity {
    private ImageView con_pic;
    private TextView con_name;
    private TextView con_intro;
    private TextView time;
    private TextView address;
    private ImageButton back;


    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.contest_detail);
        initView();
    }
    private  void initView(){
        Intent intent = getIntent();
        con_pic = (ImageView)findViewById(R.id.con_pic);
        Picasso.with(this).load(intent.getStringExtra("img")).into(con_pic);

        con_name =(TextView)findViewById(R.id.con_name);
        con_name.setText(intent.getStringExtra("con_name"));

        con_intro =(TextView)findViewById(R.id.con_intro);
        con_intro.setText(intent.getStringExtra("con_intro"));

        address =(TextView)findViewById(R.id.adress);
        address.setText(intent.getStringExtra("address"));

        time =(TextView)findViewById(R.id.time);
        time.setText(intent.getStringExtra("time"));

        back = (ImageButton)findViewById(R.id.back);
        back.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent =  new Intent(Contest_detail.this,MainActivity.class);
                //startActivity(intent);
                onBackPressed();
            }
        });

    }

}

